
<%= stylesheet_link_tag "index" %>

<h3>検索結果</h3>

<div style="margin:15px;">
<% if @entries.size != 0 %>
<%= "#{@entries.size}件のヒット" %>
<% else %>
<%= "検索結果なし" %>
<% end %>
</div>

<%
  # GoogleMapの表示
  map = GoogleMap.new(:controls => [ :zoom, :large, :scale, :type ],
                      :markerline => true);
  iconS = GoogleMapLetterIcon.new("S") 
  iconG = GoogleMapLetterIcon.new("G") 
  iconP = GoogleMapSmallIcon.new("red") 

  i = 0
  for entry in @entries do
  case i
    when 0
    icon = iconG
    when @entries.size - 1
    icon = iconS
    else
    icon = iconP
  end
  map.markers << GoogleMapMarker.new(:map => map,
                                     :icon => icon, 
                                     :lat => entry.lat, 
                                     :lng => entry.long,
                                     :draggable => false,
                                     :html => "<H1>#{h entry.subject}:</H1><br>#{image_tag(PICTURES_DIR + entry.picture_url, :size => "120x160")}<br>#{h entry.body}")
  i = i + 1
  end
%>
  <%= map.to_html %>
<div id="gmap" style="width: 580px; height: 400px;">
  <%= map.div %>
</div>
<div id='my-timeline' style="height: 200px; border: 1px solid #aaa"></div>